function getBitString(length)
{
	var bits = "";
	for (i = 0; i<length; i++) {
		var bit = 0;
		if (Math.random() > 0.5) {
			bit = 1;
		}
		bits = bits + bit;
	}
	return bits;
}

function getRandomBitPattern(width, height)
{
	var bits = "";
	var x = 0;
	do {		    
        bits += getBitString(width) + "<br>";
        x = x + 1;
    } while(x < height);
	return bits;
}

function makeBitSoup()
{
    var width = 12;
	var height = 7;
    var bitPattern = getRandomBitPattern(width, height);
    if(document.getElementById) {
		document.getElementById("headerBitsoupBits").innerHTML = bitPattern;
	}
	else if(document.all) {
  	    document.all.ExplorerFrame.innerHTML = bitPattern;
	}
	else if(document.layers) {
	    /*
		var ns4bitPattern = '<p class=\"Bits\">' + bitPattern +'</p>';
		document.NetscapeFrame.document.open();
 		document.NetscapeFrame.document.write(bitPattern);
 		document.NetscapeFrame.document.close();
 		*/
	}
	
	window.setTimeout("makeBitSoup()",1000);
}


function changeText(what, text)
{
    if(document.all) {
        what.innerHTML = text;
    }
    else if(document.layers) {
       	what.document.open();
 		what.document.write(text);
 		what.document.close();
	}
}

